package br.ifrn.tads.poo.biblioteca.dao;



import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import java.sql.Connection;
import java.sql.Statement;

public class DaoConection {
    private static Connection connection = null;

    public static Connection getConnection() {
		Connection conn;
		try {
			Class.forName("com.mysql.jdbc.Driver").newInstance(); 
			conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/biblioteca?user=root&password=123456");

			return conn;

			/**********************************************************************
			 ***********COMANDOS SELECT - INSERT - UPDATE - DELETE******************
			 **********************************************************************/

		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return null;

	}
}

